Custom List Widget
A custom list widget implementation with improved scrolling, positioning, and interaction mechanics
Author
fzzyhmstrs
Since
0.6.0
Parameters
MinecraftClient the client instance
Widgets x screen position
Widgets y screen position
Widget width in pixels
Widget height in pixels
Inheritors
Types
Properties
Functions
The length in pixels that the bottom of the list is out of frame below the bottom of the widget.
The height of the entries in the list. If the list contains twenty 20px entries, content height is 400
Ensures that the provided entry is in frame. Implementations should scroll as needed to fully incorporate the entry into the widget frame.
Return a navigation path leading through this list and to an entry, as applicable. The default implementation will likely not function properly; see DynamicListWidget for an example implementation
Handles a scroll input. This is scroll from a mouse, so the input should be multiplied by a factor to make scroll distance reasonable.
Handles "direct" scroll input. This amount is not scaled, so the amount input should be the amount scrolled.
Whether the scroll bar should not render if the widget isn't hovered. Default false.
Entries that are currently visible in the list frame. These entries will be rendered as applicable. Entries partially in frame should be included.
This is run when the widget is moved or resized. List elements should be repositioned when this is called.
Scroll to the bottom of the list content. bottomDelta should be 0 or negative after this scroll
Scroll to the top of the list content. topDelta should be 0 after this scroll.
List entries tht are currently selectable. Hidden or otherwise disabled entries should not be counted in this list.